from django.db import models

# Create your models here.
from django.db import models


class Question(models.Model):
    question_text = models.CharField(max_length=1000, verbose_name='坐标')
    question_accuracy = models.CharField(max_length=1000, verbose_name='范围')
    question_location = models.CharField(max_length=1000, verbose_name='型号')
    question_info = models.CharField(max_length=1000, verbose_name='状态')
    question_formattedAddress = models.CharField(max_length=1000, verbose_name='地址')
    question_address = models.CharField(max_length=5000, verbose_name='地址信息')
    pub_date = models.DateTimeField('日期')

    def __str__(self):
        return self.question_text

class Choice(models.Model):
    question = models.ForeignKey(Question, on_delete=models.CASCADE)
    choice_text = models.CharField(max_length=200)
    votes = models.IntegerField(default=0)

    def __str__(self):
        return self.choice_text
